<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>03居中测试</title>
  <style>
    .index{
      background-color: #ddd;
    }
    .center{
      background-color: #f5f5dc;
      width: 1000px;
      margin: 0 auto;
    }
    .card{
      background-color: pink;
      width: 300px;
      height: 500px;
      border: 10px solid #0aa1ed;
      text-align: center;
      margin: 0 auto;
    }
  </style>
</head>
<body>
<div class="index">
  <div class="center">
    <div class="card">我是内容</div>
    <div class="card">我是内容</div>
    <div class="card">我是内容</div>
    <div class="card">我是内容</div>
  </div>
</div>
</body>
</html>